package com.yh.wuye.view;

import com.yh.wuye.common.GlobalVar;
import com.yh.wuye.common.PubFun;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class BaseActivity extends Activity {
  
  protected Context ctx;
    /** Called when the activity is first created. */
  protected Button btnBack;
  protected Button btnExit;
  
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ctx = this;
    }
    
    protected void initView()
    {
      btnBack = (Button) findViewById(R.id.btn_back);
      btnBack.setOnClickListener(onBack);
      btnExit = (Button) findViewById(R.id.btn_Exit);
      btnExit.setOnClickListener(onExit);
    }
    
    private OnClickListener onBack = new OnClickListener()
    {
      
      @Override
      public void onClick(View v)
      {
        finish();
      }
    };
    
    private OnClickListener onExit = new OnClickListener()
    {
      
      @Override
      public void onClick(View v)
      {
        GlobalVar.ExitApplication = true;
        finish();
      }
    };
}